package com.s59.rabc.commen;


import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionAdvice {

    @ExceptionHandler(AccessDeniedException.class)
    public Dta handler(){
        return Dta.err(403,"无权访问");
    }

    @ExceptionHandler(Exception.class)
    public Dta handler(Exception ex){
        return Dta.err(ex.getMessage());
    }
}
